\section{error --- Raise an error}
\label{fn:error}
\index{error()}
\index{raise an error}
\index{USER-RAISED-ERROR}
\index{error messages}
\begin{rail}
Error : 'error' '(' ( () | String) ')' ;
\end{rail}

The \verb+error+ function allows user defined functions to jump back to the
prompt when they detect an error has occurred. The nature of the
error message displayed is up to the user.  If no argument is
supplied, \verb+error+ will print the default message, which is
\verb+USER-RAISED-ERROR+. If a string arguments is supplied, then that
string is displayed.

{\em Jumping back to the prompt} means execution of the current loop
or function is terminated immediately, and the control is returned to
the \RLaB\ command line.


\paragraph{Example}
\index{example of error()}
\index{error()!example}
\begin{verbatim}
> error()
rlab: USER-RAISED-ERROR
> error("The argument was of the wrong form")
rlab: The argument was of the wrong form
> error("Have you got any idea what you are doing?")
rlab: Have you got any idea what you are doing?
\end{verbatim}

See also: Page~\pageref{fn:printf} \verb+printf()+.

\newpage







